home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
demo
/
pwrtcp11.exe
/
FTP.FR_
/
FTP.bin
Wrap
Text File
|
1994-11-13
|
17KB
|
633 lines
VERSION 2.00
Begin Form FTP
Caption = "FTP Test"
ClientHeight = 6750
ClientLeft = 1095
ClientTop = 1500
ClientWidth = 9660
Height = 7155
Icon = FTP.FRX:0000
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 6750
ScaleWidth = 9660
Top = 1155
Width = 9780
Begin TextBox Text3
Height = 2775
Left = 3600
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 48
Top = 480
Width = 2895
End
Begin TextBox Text1
Height = 2775
Left = 6600
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 47
Top = 480
Width = 2895
End
Begin CommandButton Command24
Caption = "Misc3"
Height = 255
Left = 2160
TabIndex = 45
Top = 3000
Width = 855
End
Begin CommandButton Command23
Caption = "Misc2"
Height = 255
Left = 1200
TabIndex = 44
Top = 3000
Width = 735
End
Begin CommandButton Command22
Caption = "Misc1"
Height = 255
Left = 120
TabIndex = 43
Top = 3000
Width = 855
End
Begin TextBox CommandStr
Height = 285
Left = 1200
TabIndex = 39
Text = "PWD"
Top = 2640
Width = 2175
End
Begin CommandButton Command18
Caption = "Command"
Height = 255
Left = 120
TabIndex = 38
Top = 2640
Width = 855
End
Begin TextBox FileSize
Height = 285
Left = 1200
TabIndex = 35
Text = "1024 512"
Top = 2280
Width = 1815
End
Begin CommandButton Command15
Caption = "Allocate"
Height = 255
Left = 120
TabIndex = 34
Top = 2280
Width = 855
End
Begin CommandButton Cle
Caption = "Clear"
Height = 255
Left = 3720
TabIndex = 32
Top = 120
Width = 735
End
Begin Frame Frame2
Caption = "Data"
Height = 2895
Left = 120
TabIndex = 19
Top = 3360
Width = 9375
Begin CommandButton Command25
Caption = "RENAME"
Height = 255
Left = 960
TabIndex = 46
Top = 2520
Width = 735
End
Begin CommandButton Command21
Caption = "RMD"
Height = 255
Left = 120
TabIndex = 42
Top = 2520
Width = 735
End
Begin CommandButton Command20
Caption = "MKD"
Height = 255
Left = 120
TabIndex = 41
Top = 2160
Width = 735
End
Begin CommandButton Command19
Caption = "DELE"
Height = 255
Left = 2640
TabIndex = 40
Top = 2160
Width = 735
End
Begin CommandButton Command17
Caption = "CDUP"
Height = 255
Left = 960
TabIndex = 37
Top = 2160
Width = 735
End
Begin CommandButton Command16
Caption = "CWD"
Height = 255
Left = 960
TabIndex = 36
Top = 1800
Width = 735
End
Begin TextBox LocalName
Height = 375
Left = 1440
TabIndex = 30
Text = "local.dat"
Top = 840
Width = 1695
End
Begin CommandButton Command13
Caption = "ASCII"
Height = 255
Left = 120
TabIndex = 28
Top = 1800
Width = 735
End
Begin CommandButton Command12
Caption = "IMAGE"
Height = 255
Left = 120
TabIndex = 27
Top = 1440
Width = 735
End
Begin CommandButton Command10
Caption = "PWD"
Height = 255
Left = 960
TabIndex = 25
Top = 1440
Width = 735
End
Begin CommandButton Command9
Caption = "RETR"
Height = 255
Left = 1800
TabIndex = 1
Top = 2520
Width = 735
End
Begin CommandButton Command8
Caption = "APPE"
Height = 255
Left = 1800
TabIndex = 2
Top = 2160
Width = 735
End
Begin CommandButton Command7
Caption = "STOU"
Height = 255
Left = 1800
TabIndex = 3
Top = 1800
Width = 735
End
Begin CommandButton Command6
Caption = "STOR"
Height = 255
Left = 1800
TabIndex = 8
Top = 1440
Width = 735
End
Begin TextBox Text2
Height = 2415
Left = 3600
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 24
Top = 360
Width = 5655
End
Begin CommandButton Command5
Caption = "NLST"
Height = 255
Left = 2640
TabIndex = 23
Top = 1800
Width = 735
End
Begin CommandButton Command4
Caption = "LIST"
Height = 255
Left = 2640
TabIndex = 22
Top = 1440
Width = 735
End
Begin TextBox PathName
Height = 375
Left = 1440
TabIndex = 21
Text = "test.ftp"
Top = 360
Width = 1695
End
Begin Label Label7
Caption = "LocalName"
Height = 255
Left = 120
TabIndex = 29
Top = 840
Width = 975
End
Begin Label Label6
Caption = "RemoteName"
Height = 255
Left = 120
TabIndex = 20
Top = 360
Width = 1215
End
End
Begin TextBox User
Height = 285
Left = 1200
TabIndex = 5
Text = "Name"
Top = 840
Width = 1095
End
Begin TextBox Host
Height = 285
Left = 1200
TabIndex = 4
Text = "Name"
Top = 480
Width = 1095
End
Begin CommandButton Abort
Caption = "Abort"
Height = 255
Left = 2400
TabIndex = 11
Top = 1080
Width = 855
End
Begin CommandButton Command2
Caption = "Logout"
Height = 255
Left = 2400
TabIndex = 10
Top = 1440
Width = 855
End
Begin CommandButton Command1
Caption = "Login"
Height = 255
Left = 2400
TabIndex = 9
Top = 360
Width = 855
End
Begin TextBox Acct
Height = 285
Left = 1200
TabIndex = 7
Text = "Name"
Top = 1560
Width = 1095
End
Begin TextBox Pass
Height = 285
Left = 1200
TabIndex = 6
Text = "*******"
Top = 1200
Width = 1095
End
Begin CommandButton Command3
Caption = "Clear"
Height = 255
Left = 6600
TabIndex = 14
Top = 120
Width = 735
End
Begin PowerTCP_FTP FTP1
Flags = 8
Left = 6000
OemLicense = ""
Top = 0
End
Begin Frame Frame1
BackColor = &H00FFFFFF&
Caption = "Login/Logout"
ClipControls = 0 'False
Height = 2055
Left = 120
TabIndex = 0
Top = 120
Width = 3255
Begin CommandButton Command14
Caption = "Kill"
Height = 255
Left = 2280
TabIndex = 31
Top = 1680
Width = 855
End
Begin CommandButton Command11
Caption = "Rein"
Height = 255
Left = 2280
TabIndex = 26
Top = 600
Width = 855
End
Begin Label Label5
Caption = "Account"
Height = 255
Left = 120
TabIndex = 18
Top = 1440
Width = 735
End
Begin Label Label4
Caption = "Password"
Height = 255
Left = 120
TabIndex = 17
Top = 1080
Width = 855
End
Begin Label Label3
Caption = "User"
Height = 255
Left = 120
TabIndex = 16
Top = 720
Width = 615
End
Begin Label Label1
Caption = "Host"
Height = 255
Left = 120
TabIndex = 15
Top = 360
Width = 615
End
End
Begin Label Label2
Caption = "Log"
Height = 255
Index = 1
Left = 4680
TabIndex = 33
Top = 120
Width = 495
End
Begin Label Status1
BackColor = &H00C0C0C0&
Height = 375
Left = 0
TabIndex = 13
Top = 6360
Width = 4815
End
Begin Label Label2
Caption = "Replies"
Height = 255
Index = 0
Left = 7560
TabIndex = 12
Top = 120
Width = 735
End
End
Dim FileNum As Integer ' local to form
Sub Abort_Click ()
FTP1.Abort = True
End Sub
Sub Cle_Click ()
Text3 = ""
End Sub
Sub Command1_Click ()
Text1 = ""
Text3 = ""
FTP1.User = User
FTP1.Password = Pass
FTP1.Account = Acct
FTP1.LoginHost = Host
End Sub
Sub Command10_Click ()
FTP1.PrintWorkingDir = True
End Sub
Sub Command11_Click ()
FTP1.Reinitialize = True
End Sub
Sub Command12_Click ()
FTP1.Type = "I"
End Sub
Sub Command13_Click ()
FTP1.Type = "A"
End Sub
Sub Command14_Click ()
FTP1.CloseControl = True
End Sub
Sub Command15_Click ()
FTP1.Allocate = FileSize
End Sub
Sub Command16_Click ()
FTP1.ChDir = PathName
End Sub
Sub Command17_Click ()
FTP1.ChDirUp = True
End Sub
Sub Command18_Click ()
FTP1.Command = CommandStr
End Sub
Sub Command19_Click ()
FTP1.Dele = PathName
End Sub
Sub Command2_Click ()
FTP1.Logout = True
End Sub
Sub Command20_Click ()
FTP1.MakeDir = PathName
End Sub
Sub Command21_Click ()
FTP1.RemoveDir = PathName
End Sub
Sub Command22_Click ()
FTP1.Restart = CommandStr
End Sub
Sub Command23_Click ()
FTP1.Status = CommandStr
End Sub
Sub Command24_Click ()
FTP1.System = True
End Sub
Sub Command25_Click ()
FTP1.Rename = PathName
End Sub
Sub Command3_Click ()
Text1 = ""
End Sub
Sub Command4_Click ()
Text2.Text = ""
FileNum = 0
FTP1.List = PathName
End Sub
Sub Command5_Click ()
Text2.Text = ""
FTP1.NameList = PathName
End Sub
Sub Command6_Click ()
Text2.Text = ""
FileNum = 2' read data from file
'FileNum = 10 'put in bit bucket
Open LocalName For Binary Access Read As #2
FTP1.Store = PathName
End Sub
Sub Command7_Click ()
Text2.Text = ""
FileNum = 2' read data from file
'FileNum = 10 'put in bit bucket
Open LocalName For Binary Access Read As #2
FTP1.StoreUnique = PathName
End Sub
Sub Command8_Click ()
Text2.Text = ""
FileNum = 2' read data from file
'FileNum = 10 'put in bit bucket
Open LocalName For Binary Access Read As #2
FTP1.Appe = PathName
End Sub
Sub Command9_Click ()
Text2.Text = ""
FileNum = 1' save data to file
'FileNum = 2 'put in bit bucket
Open LocalName For Output As #1
FTP1.Retrieve = PathName
End Sub
Sub Form_Load ()
FileNum = 0
FTP1.User = User
FTP1.Password = Pass
FTP1.Account = Acct
'FTP1.LoginHost = Host
End Sub
Sub Form_Unload (Cancel As Integer)
End
End Sub
Sub FTP1_Log (Message As String)
Text3 = Text3 & Message & Chr$(13) & Chr$(10)
End Sub
Sub FTP1_Recv (RecvData As String)
Select Case FileNum
Case 0
' put data to edit box: list or name list
Text2 = Text2 & RecvData
Case 1
' put data into open file
If RecvData = "" Then
Close #1
FileNum = 0
Else
Print #1, RecvData;
End If
End Select
End Sub
Sub FTP1_Reply (Status As Integer, LastCommand As Integer, Code As Integer, Reply As String)
Text1 = Text1 & Reply & Chr$(13) & Chr$(10)
Select Case (Status)
Case FTP_UNKNOWN ' spontaneous data or reply from Command
Status1 = "Unknown"
Case FTP_SUCCESS ' operation completed sucessfully
Status1 = "Success"
'If Code = 226 And FileNum = 1 Then
' file transfer successful
'Close #FileNum
'FileNum = 0
'End If
Case FTP_ERROR ' unexpected error
Status1 = "Error"
If FileNum = 1 Then
Close #1
FileNum = 0
End If
Case FTP_FAILURE ' failure to complete successfully
Status1 = "Failure"
If FileNum = 1 Then
Close #1
FileNum = 0
End If
Case FTP_WORKING ' informative...wait for next
Status1 = "Working"
End Select
End Sub
Sub FTP1_Send (Tag As Long)
' get data from open file
Location = Loc(2)
LengthOfFile = LOF(2)
Transfer = LengthOfFile - Location
If Transfer > 12000 Then Transfer = 12000
If Transfer > 0 Then
FTP1.Send = Input$(Transfer, #2)
Else
FTP1.CloseData = True
Close #2
FileNum = 0
End If
End Sub